package com.xyebank.ledger.conf;

import com.xyebank.ledger.service.common.MigService;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 迁移任务实体bean
 */
public class MigTaskBean {

    private Map<String, MigService> taskMap;

    public MigTaskBean() {
        taskMap = new HashMap<>();
    }

    /**
     * 增加新迁移任务
     * @param type
     * @param migService
     */
    public void addTask(String type, MigService migService) {
        taskMap.put(type, migService);
    }

    public MigService getMigService(String type) {
        return taskMap.get(type);
    }

    public List<MigService> getTaskList() {
        return new ArrayList<>(taskMap.values());
    }

}
